import React, { useEffect } from 'react';
import { connect } from 'react-redux';
import Table1 from '@/components/Table1';
import { Input } from 'antd';
const { Search } = Input;

export const Rent = (props: any) => {
  // 搜索
  const onSearch = (value: string) => {
    console.log(value);
    props.dispatch({ type: 'shoprent/SEARCH', value });
  };

  return (
    <div>
      <Search
        placeholder="input search text"
        allowClear
        enterButton="Search"
        size="large"
        onSearch={onSearch}
      />
      <Table1 data={props.list} />
    </div>
  );
};

const mapStateToProps = (state: any) => {
  // console.log(state);
  return {
    list: state.shoprent.rentlist
  };
};

export default connect(mapStateToProps)(Rent);
